const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

module.exports = {
  mode: 'development',
  devtool: 'source-map',
  plugins: [
    new webpack.DefinePlugin({
      PI: `Math.PI`,
      VERSION: `'5.5.5'`,
      DOMAIN: JSON.stringify('star.top')
    }),
    new HtmlWebpackPlugin({
      template: './public/index.html',
      filename: 'index.html',
      inject: 'body'
    }),

    new webpack.BannerPlugin({
      banner: `
      发光如星
      hash:[hash]
      chunkhash:[chunkhash]
      `
    }),

    new webpack.ProvidePlugin({
      $: 'jquery',
      _: 'loadsh'
    })

  ],
  devServer: {
    openPage: 'index.html',
    stats: {
      colors: true,
      modules: false
    }
  }
}